package com.light.gulimall.ware.dao;

import com.light.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author minmin
 * @email 980680541@gmail.com
 * @date 2024-07-16 21:32:14
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    Long queryStockBySkuId(@Param("skuId") Long skuId);

    List<Long> selectWareIdBySkuId(@Param("skuId") Long skuId);

    int stockLock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("count") Integer count);

    void stockRelease(@Param("wareId") Long wareId, @Param("skuId") Long skuId, @Param("skuNum") Integer skuNum);
}
